package com.UdpRecieve.Netty.protocol;


import com.UdpRecieve.domain.FilePigeonhole;


import java.io.File;

import static com.UdpRecieve.Netty.protocol.command.Command.FILE_PACKET;



public class FilePacket extends Packet {

	private File file;
	private long fileLength;
	private int ACK;
	private String fileTime;
	private FilePigeonhole filePigeonhole;

	public FilePigeonhole getFilePigeonhole() {
		return filePigeonhole;
	}

	public void setFilePigeonhole(FilePigeonhole filePigeonhole) {
		this.filePigeonhole = filePigeonhole;
	}

	private byte[] bytes;

	public byte[] getBytes() {
		return bytes;
	}

	public void setBytes(byte[] bytes) {
		this.bytes = bytes;
	}

	public String getFileTime() {
		return fileTime;
	}

	public void setFileTime(String fileTime) {
		this.fileTime = fileTime;
	}

	@Override
	public Byte getCommand() {
		return FILE_PACKET;
	}

	public FilePacket() {
	}

	public FilePacket(File file) {
		this.file = file;
		this.fileLength = file.length();
	}

	public FilePacket(File file, int ACK) {
		this.file = file;
		this.ACK = ACK;
	}

	public Long getFileLength() {
		return fileLength;
	}
	public void setFileLength(long fileLength) {
		this.fileLength = fileLength;
	}
	public void setFileLength(Long fileLength) {
		fileLength = fileLength;
	}

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public int getACK() {
		return ACK;
	}

	public void setACK(int ACK) {
		this.ACK = ACK;
	}
}
